package com.xtravel.discovery.adapter;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.lidroid.xutils.BitmapUtils;
import java.util.List;
import com.xtravel.common.adapter.BaseDataAdapter;
import com.xtravel.discovery.dto.TalentDto;
import com.xtravel.discovery.viewholder.BaseViewHolder;
import com.xtravel.discovery.viewholder.LiveTalentViewHolder;

public class LiveTalentListAdapter extends BaseDataAdapter<TalentDto> {
    private final BitmapUtils bitmapUtils;
    private final Context context;
    private LayoutInflater mInflater;

    public LiveTalentListAdapter(Context context, BitmapUtils bitmapUtils, List<TalentDto> data) {
        super(data);
        this.context = context;
        this.mInflater = LayoutInflater.from(context);
        this.bitmapUtils = bitmapUtils;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup viewGroup) {
        BaseViewHolder holder;
        if (convertView == null) {
            holder = new LiveTalentViewHolder(this.context, this.bitmapUtils, this.mInflater);
            convertView = holder.getView();
        } else {
            holder = (BaseViewHolder) convertView.getTag();
        }

        TalentDto item = getItem(position);
        holder.setValue(item);
        return convertView;
    }

    @Override
    public void getData(Object args) {
    }

    @Override
    protected void updateData(List<TalentDto> data) {
    }


}